<%@ page contentType="text/html; charset=UTF-8" %>
<jsp:useBean id="boardMgr" class="com.group.board.BoardMgr"/>
<jsp:useBean id="boardBean" class="com.group.board.BoardData"/>
<%
String num = request.getParameter("num");
String spage = request.getParameter("page");
boardBean = boardMgr.getEditData(num);
%>

<html><head><title>게시판</title>
<link rel="stylesheet" type="text/css" href="board.css">
<script>
function check(){
	if(frm.name.value==""){
		alert("이름을 입력하세요");
		frm.name.focus();
	}else if(frm.pass.value ==""){
		alert("비밀번호를 입력하세요");
		frm.pass.focus();
	}else if(frm.mail.value ==""){
		alert("이메일을 입력하세요");
		frm.mail.focus();
	}else if(frm.title.value ==""){
		alert("제목을 입력하세요");
		frm.title.focus();
	}else if(frm.cont.value ==""){
		alert("내용을 입력하세요");
		frm.cont.focus();
	}else
		frm.submit();
}
</script>	
</head>
<body topmargin=50 leftmargin=50 onLoad=frm.name.focus() bgcolor="beige">
<center><h2>공지사항 수정</h2>
<form name="frm" method="post" action="editsave.jsp">
<input type="hidden"name="num"value="<%=num%>"> <!--editsave로 num과 spage를 함께 가져감  -->
<input type="hidden"name="page"value="<%=spage%>">
<table border="1" style="border-collapse=collapse"  width=530>
<tr>
	<td align=center width=100>이 름</td>
	<td width=430><input name=name size=15 value="<%=boardBean.getName()%>"></td>
</tr>
<tr>
	<td align=center >암 호</td>
	<td width=430><input type=password name=pass size=15></td>
</tr>
<tr>
	<td align=center>메 일</td>
	<td><input name=mail size=25 value="<%=boardBean.getMail()%>"></td>
</tr>
<tr>
	<td align=center>제 목</td>
	<td><input name=title size=50 value="<%=boardBean.getTitle()%>"></td>
</tr>
<tr>
	<td align=center>내 용</td>
	<td><textarea name=cont cols=50 rows=12 ><%=boardBean.getCont()%></textarea></td>
</tr>
<tr>
	<td colspan=2 align=center height=30>
		<input type=button value="메  인" onClick="location.href='boardlist.jsp'"> &nbsp; 
		<input type="reset" value="다시쓰기"> &nbsp; 
		<input type=button  value="작  성" onClick="check()" >
	</td>
</tr>
</form>
</table></center></body></html>